package collection;


import java.util.ArrayList;
import java.util.List;

public class ListDemo3 {
    public static void main(String[] args) {
        List<Integer> list=new ArrayList<>();
        for(int i=0;i<10;i++)
        {
            list.add(i);
        }
        System.out.println(list);
        List<Integer>sublist=list.subList(1,9);
        System.out.println(sublist);
        for(int i=0;i<sublist.size();i++)
            sublist.set(i,sublist.get(i)*10);
        System.out.println(sublist);
        System.out.println(list);//对子集的操作就是对原集进行操作
        //删除list集合的1-8元素
        sublist.clear();
        System.out.println(list);
    }
}
